class EcardMailer < ActionMailer::Base

  def sendcard(fromemail, toemail, fromname, toname, message, code, sent_at = Time.now)
    @subject    = 'I sent you an eCard from HenryWagnerPhotography.com'
    @recipients = toemail
    @from       = fromemail
    @sent_on    = sent_at
    @body["fromemail"] = fromemail
    @body["fromname"]  = fromname
    @body["toname"]    = toname
    @body["message"]   = message
    @body["code"]      = code
  end

  def cardread(fromemail, code, sent_at = Time.now)
    @subject      = '[HenryWagnerPhotography] ecard has been read'
    @recipients   = 'hjw3001@gmail.com'
    @from         = fromemail
    @sent_on      = sent_at
    @body["code"] = code
  end

  def adminsent(fromemail, toemail, fromname, toname, message, code, sent_at = Time.now)
    @subject    = '[HenryWagnerPhotography] New ecard sent'
    @recipients = 'hjw3001@gmail.com'
    @from       = fromemail
    @sent_on    = sent_at
    @body["fromemail"] = fromemail
    @body["fromname"]  = fromname
    @body["toname"]    = toname
    @body["toemail"]    = toemail
    @body["message"]   = message
    @body["code"]      = code
  end
  
end
